home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / complib / iirm1d.z / iirm1d
Encoding:
Text File  |  1998-10-30  |  14.9 KB  |  265 lines

  1.  
  2.  
  3.  
  4. ____IIIIIIIIRRRRMMMM1111DDDD((((3333FFFF))))                                                        ____IIIIIIIIRRRRMMMM1111DDDD((((3333FFFF))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      SIIRM1D, DIIRM1D, CIIRM1D, ZIIRM1D - N 1D convolutions in the time
  10.      domain.
  11.  
  12. FFFFOOOORRRRTTTTRRRRAAAANNNN SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  13.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee SSSSIIIIIIIIRRRRMMMM1111DDDD(((( ffff,,,, iiiinnnnccccffff,,,, llllddddffff,,,, iiiiffffxxxx0000,,,, nnnn____ffffxxxx,,,, nnnnyyyy,,,,
  14.                          gggg,,,, iiiinnnnccccgggg,,,,      iiiiggggxxxx0000,,,, nnnn____ggggxxxx,,,,
  15.                          hhhh,,,, iiiinnnncccchhhh,,,, llllddddhhhh,,,, iiiihhhhxxxx0000,,,, nnnn____hhhhxxxx ))))
  16.  
  17.      iiiinnnntttteeeeggggeeeerrrr             iiiinnnnccccffff,,,, llllddddffff,,,, iiiiffffxxxx0000,,,, nnnn____ffffxxxx,,,, nnnnyyyy,,,,
  18.                          iiiinnnnccccgggg,,,, iiiiggggxxxx0000,,,, nnnn____ggggxxxx,,,,
  19.                          iiiinnnncccchhhh,,,, llllddddhhhh,,,, iiiihhhhxxxx0000,,,, nnnn____hhhhxxxx
  20.  
  21.      rrrreeeeaaaallll                ffff((((llllddddffff,,,,nnnnyyyy)))),,,, gggg((((****)))),,,, hhhh((((llllddddhhhh,,,,nnnnyyyy))))
  22.  
  23.  
  24.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee DDDDIIIIIIIIRRRRMMMM1111DDDD(((( ffff,,,, iiiinnnnccccffff,,,, llllddddffff,,,, iiiiffffxxxx0000,,,, nnnn____ffffxxxx,,,, nnnnyyyy,,,,
  25.                          gggg,,,, iiiinnnnccccgggg,,,,      iiiiggggxxxx0000,,,, nnnn____ggggxxxx,,,,
  26.                          hhhh,,,, iiiinnnncccchhhh,,,, llllddddhhhh,,,, iiiihhhhxxxx0000,,,, nnnn____hhhhxxxx ))))
  27.  
  28.      iiiinnnntttteeeeggggeeeerrrr             iiiinnnnccccffff,,,, llllddddffff,,,, iiiiffffxxxx0000,,,, nnnn____ffffxxxx,,,, nnnnyyyy,,,,
  29.                          iiiinnnnccccgggg,,,, iiiiggggxxxx0000,,,, nnnn____ggggxxxx,,,,
  30.                          iiiinnnncccchhhh,,,, llllddddhhhh,,,, iiiihhhhxxxx0000,,,, nnnn____hhhhxxxx
  31.  
  32.      ddddoooouuuubbbblllleeee pppprrrreeeecccciiiissssiiiioooonnnn    ffff((((llllddddffff,,,,nnnnyyyy)))),,,, gggg((((****)))),,,, hhhh((((llllddddhhhh,,,,nnnnyyyy))))
  33.  
  34.  
  35.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee CCCCIIIIIIIIRRRRMMMM1111DDDD(((( ffff,,,, iiiinnnnccccffff,,,, llllddddffff,,,, iiiiffffxxxx0000,,,, nnnn____ffffxxxx,,,, nnnnyyyy,,,,
  36.                          gggg,,,, iiiinnnnccccgggg,,,,      iiiiggggxxxx0000,,,, nnnn____ggggxxxx,,,,
  37.                          hhhh,,,, iiiinnnncccchhhh,,,, llllddddhhhh,,,, iiiihhhhxxxx0000,,,, nnnn____hhhhxxxx ))))
  38.  
  39.      iiiinnnntttteeeeggggeeeerrrr             iiiinnnnccccffff,,,, llllddddffff,,,, iiiiffffxxxx0000,,,, nnnn____ffffxxxx,,,, nnnnyyyy,,,,
  40.                          iiiinnnnccccgggg,,,, iiiiggggxxxx0000,,,, nnnn____ggggxxxx,,,,
  41.                          iiiinnnncccchhhh,,,, llllddddhhhh,,,, iiiihhhhxxxx0000,,,, nnnn____hhhhxxxx
  42.  
  43.      ccccoooommmmpppplllleeeexxxx             ffff((((llllddddffff,,,,nnnnyyyy)))),,,, gggg((((****)))),,,, hhhh((((llllddddhhhh,,,,nnnnyyyy))))
  44.  
  45.  
  46.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ZZZZIIIIIIIIRRRRMMMM1111DDDD(((( ffff,,,, iiiinnnnccccffff,,,, llllddddffff,,,, iiiiffffxxxx0000,,,, nnnn____ffffxxxx,,,, nnnnyyyy,,,,
  47.                          gggg,,,, iiiinnnnccccgggg,,,,      iiiiggggxxxx0000,,,, nnnn____ggggxxxx,,,,
  48.                          hhhh,,,, iiiinnnncccchhhh,,,, llllddddhhhh,,,, iiiihhhhxxxx0000,,,, nnnn____hhhhxxxx ))))
  49.  
  50.      iiiinnnntttteeeeggggeeeerrrr             iiiinnnnccccffff,,,, llllddddffff,,,, iiiiffffxxxx0000,,,, nnnn____ffffxxxx,,,, nnnnyyyy,,,,
  51.                          iiiinnnnccccgggg,,,, iiiiggggxxxx0000,,,, nnnn____ggggxxxx,,,,
  52.                          iiiinnnncccchhhh,,,, llllddddhhhh,,,, iiiihhhhxxxx0000,,,, nnnn____hhhhxxxx
  53.  
  54.      ddddoooouuuubbbblllleeee ccccoooommmmpppplllleeeexxxx      ffff((((llllddddffff,,,,nnnnyyyy)))),,,, gggg((((****)))),,,, hhhh((((llllddddhhhh,,,,nnnnyyyy))))
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ____IIIIIIIIRRRRMMMM1111DDDD((((3333FFFF))))                                                        ____IIIIIIIIRRRRMMMM1111DDDD((((3333FFFF))))
  71.  
  72.  
  73.  
  74. CCCC SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  75.      ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooonnnnvvvv....hhhh>>>>
  76.  
  77.      vvvvooooiiiidddd ssssiiiiiiiirrrrmmmm1111dddd(((( ffffllllooooaaaatttt ****ffff,,,, iiiinnnntttt iiiinnnnccccffff,,,, iiiinnnntttt llllssssffff,,,, iiiinnnntttt iiiiffffxxxx0000,,,, iiiinnnntttt nnnn____ffffxxxx,,,,
  78.                    iiiinnnntttt nnnn____sssseeeeqqqq,,,,
  79.                    ffffllllooooaaaatttt ****gggg,,,, iiiinnnntttt iiiinnnnccccgggg,,,, iiiinnnntttt iiiiggggxxxx0000,,,, iiiinnnntttt nnnn____ggggxxxx,,,,
  80.                    ffffllllooooaaaatttt ****hhhh,,,, iiiinnnntttt iiiinnnncccchhhh,,,, iiiinnnntttt llllddddhhhh,,,, iiiinnnntttt iiiihhhhxxxx0000,,,, iiiinnnntttt nnnn____hhhhxxxx ))))
  81.  
  82.      vvvvooooiiiidddd ddddiiiiiiiirrrrmmmm1111dddd(((( ddddoooouuuubbbblllleeee ****ffff,,,, iiiinnnntttt iiiinnnnccccffff,,,, iiiinnnntttt llllddddffff,,,, iiiinnnntttt iiiiffffxxxx0000,,,, iiiinnnntttt nnnn____ffffxxxx,,,,
  83.                    iiiinnnntttt nnnn____sssseeeeqqqq,,,,
  84.                    ddddoooouuuubbbblllleeee ****gggg,,,, iiiinnnntttt iiiinnnnccccgggg,,,, iiiinnnntttt iiiiggggxxxx0000,,,, iiiinnnntttt nnnn____ggggxxxx,,,,
  85.                    ddddoooouuuubbbblllleeee ****hhhh,,,, iiiinnnntttt iiiinnnncccchhhh,,,, iiiinnnntttt llllddddhhhh,,,, iiiinnnntttt iiiihhhhxxxx0000,,,, iiiinnnntttt nnnn____hhhhxxxx ))))
  86.  
  87.      vvvvooooiiiidddd cccciiiiiiiirrrrmmmm1111dddd(((( ccccoooommmmpppplllleeeexxxx ****ffff,,,, iiiinnnntttt iiiinnnnccccffff,,,, iiiinnnntttt llllddddffff,,,, iiiinnnntttt iiiiffffxxxx0000,,,, iiiinnnntttt nnnn____ffffxxxx,,,,
  88.                    iiiinnnntttt nnnn____sssseeeeqqqq,,,,
  89.                    ccccoooommmmpppplllleeeexxxx ****gggg,,,, iiiinnnntttt iiiinnnnccccgggg,,,, iiiinnnntttt iiiiggggxxxx0000,,,, iiiinnnntttt nnnn____ggggxxxx,,,,
  90.                    ccccoooommmmpppplllleeeexxxx ****hhhh,,,, iiiinnnntttt iiiinnnncccchhhh,,,, iiiinnnntttt llllddddhhhh,,,, iiiinnnntttt iiiihhhhxxxx0000,,,, iiiinnnntttt nnnn____hhhhxxxx ))))
  91.  
  92.      vvvvooooiiiidddd zzzziiiiiiiirrrrmmmm1111dddd(((( zzzzoooommmmpppplllleeeexxxx ****ffff,,,, iiiinnnntttt iiiinnnnccccffff,,,, iiiinnnntttt llllddddffff,,,, iiiinnnntttt iiiiffffxxxx0000,,,, iiiinnnntttt nnnn____ffffxxxx,,,,
  93.                    iiiinnnntttt nnnn____sssseeeeqqqq,,,,
  94.                    zzzzoooommmmpppplllleeeexxxx ****gggg,,,, iiiinnnntttt iiiinnnnccccgggg,,,, iiiinnnntttt iiiiggggxxxx0000,,,, iiiinnnntttt nnnn____ggggxxxx,,,,
  95.                    zzzzoooommmmpppplllleeeexxxx ****hhhh,,,, iiiinnnntttt iiiinnnncccchhhh,,,, iiiinnnntttt llllddddhhhh,,,, iiiinnnntttt iiiihhhhxxxx0000,,,, iiiinnnntttt nnnn____hhhhxxxx ))))
  96.  
  97.  
  98.  
  99. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  100.      SIIRM1D, DIIRM1D, CIIRM1D and DIIRM1D compute N 1D convolutions in the
  101.      time domain :
  102.  
  103.       h(i,j) = beta * h(i,j) + alpha * Sum[ f(k,j) * g(i-k) ] with j=1,...,N
  104.  
  105.      _IIRM1D can be used instead of _IIR2D when the 2D filter can be
  106.      decomposed into the convolution of two 1D filters.
  107.  
  108.      For example:
  109.          ------------------   ------------------       ------------------
  110.          | 0.25 -.50 0.25 |   | 0.   -.50 0.   |       | 0.   0.   0.   |
  111.          | -.50 1.00 -.50 | = | 0.   1.00 0.   |  (*)  | -.50 1.00 -.50 |
  112.          | 0.25 -.50 0.25 |   | 0.   -.50 0.   |       | 0.   0.   0.   |
  113.          |________________|   |________________|       |________________|
  114.  
  115.      In these special cases, filtering an Image (NxN) by a Filter (MxM) can
  116.      requires:
  117.           only           2 * M * N * N  flop (using "diirm1d" twice)
  118.           as much as     M * M * N * N  flop (using "diir2d")
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ____IIIIIIIIRRRRMMMM1111DDDD((((3333FFFF))))                                                        ____IIIIIIIIRRRRMMMM1111DDDD((((3333FFFF))))
  137.  
  138.  
  139.  
  140. USAGE:
  141.      1. Suppose you want to:
  142.             filter a 2D "image" f(0:449,0:699) along the first dimension ,
  143.         by  a 1D filter g(-15:15),
  144.             put the result in h(0:299,0:699),
  145.         you can use:
  146.  
  147.            call diirm1d(   f(0,0), 449-0+1, 1, 0, 449-0+1, 699+1,
  148.                            g(-15), 1, -15, 15-(-15)+1,
  149.           $                h(0, 0), 229-0+1, 0, 299-0+1 )
  150.  
  151.      2. Suppose you want to:
  152.             filter a 2D "image" f(0:449,0:699) along the Second dimension ,
  153.         by  the Fisrt line of g(0:149,-15:15),
  154.             put the result in h(-25:449,0:699),
  155.         you can use:
  156.  
  157.            call diirm1d(   f(0, 0), 699-0+1, 1, 0, 449-0+1,
  158.           $                g(0, -15), 1, 149-25+1, -15, 15,
  159.           $                h(0, 0), 449-0+1, 1, 0, 449-0+1 )
  160.  
  161.  
  162. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  163.      ffff       Vector containing the 2D sequence "f"
  164.  
  165.      iiiinnnnccccffff    Increment between two successive values of "f"
  166.  
  167.      llllddddffff     Increment between two successive 1D sequnce of "f"
  168.  
  169.      iiiiffffxxxx0000    Index of the first element of each 1D sequence of "f"
  170.  
  171.      nnnn____ffffxxxx    Number of elements of each sequence of "f"
  172.  
  173.      nnnnyyyy      Number of 1D sequences to filter
  174.  
  175.  
  176.      gggg       Vector containing the 1D sequence "g"
  177.  
  178.      iiiinnnnccccgggg    Increment between two successive values of "g"
  179.  
  180.      iiiiggggxxxx0000    Index of the first element of each 1D sequence of "g"
  181.  
  182.      nnnn____ggggxxxx    Number of elements of Each sequence of "g"
  183.  
  184.  
  185.      hhhh       Vector containing the 2D sequence "h"
  186.  
  187.      iiiinnnncccchhhh    Increment between two successive values of "h"
  188.  
  189.      llllddddhhhh     Increment between two successive 1D sequnce of "h"
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. ____IIIIIIIIRRRRMMMM1111DDDD((((3333FFFF))))                                                        ____IIIIIIIIRRRRMMMM1111DDDD((((3333FFFF))))
  203.  
  204.  
  205.  
  206.      iiiihhhhxxxx0000    Index of the first element of each 1D sequence of "h"
  207.  
  208.      nnnn____hhhhxxxx    Number of elements of Each sequence of "h"
  209.  
  210.  
  211.  
  212. IIIIMMMMPPPPOOOORRRRTTTTAAAANNNNTTTT NNNNOOOOTTTTEEEE::::
  213.            The array pointers must all point to the first element of the
  214.            array "(ifx0,ify0)", "(igx0,igy0)" and "(ihx0,ihy0)". If "f"
  215.            for example is defined as
  216.                 dimension f(-25:45,10:21)
  217.            Then "diirm1d" must be called with the following parameters
  218.                 call diirm1d( f(-25,10),(45-(-25)+1),-25,45,10,21 ... )
  219.  
  220.  
  221. AAAAUUUUTTTTHHHHOOOORRRRSSSS
  222.           Jean-Pierre Panziera, 1/12/93.
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.